package es.uned.hoomgle.core.services.interfaces;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import es.uned.hoomgle.core.exceptions.HoomgleException;
import es.uned.hoomgle.hibernate.beans.interfaces.HomeI;
import es.uned.hoomgle.hibernate.beans.interfaces.ParameterI;
import es.uned.hoomgle.hibernate.beans.interfaces.UserI;
import es.uned.hoomgle.hibernate.daos.impl.ParameterDao;

public interface UserServiceI {

	/**
	 * Persistencia del usuario
	 * @param user
	 * @return
	 */
	@Transactional
	public abstract UserI save(UserI user);
	
	@Transactional
	public abstract List <UserI> getQuery(String query);
    
	@Transactional
	public abstract int delete(String query);
	
	@Transactional
	public UserI getUserByUserName(String userName);
	

	@Transactional
	public void deleteUser(String username);
	
	/**
	 * Recupera un usuario por id
	 * @param id
	 * @return
	 */
	@Transactional
	public UserI loadUser(Integer id);
	
	/**
	 * Nuevo Usuario
	 * @param user
	 * @return
	 * @throws HoomgleException
	 */
	@Transactional
	public UserI newUser (UserI user) throws HoomgleException;
	
	@Transactional
	public void UnsubscribeUser(String username) throws HoomgleException;
	
	
}